#! /usr/bin/python3
# coding=utf-8
# @Time: 2023/11/13 12:19 下午
# @Author: william

class LeftMenuBase:

    def level_one_menu(self, menu_name):
        """
        一级菜单栏，菜单栏名称
        :return:
        """
        return "//aside[@class='el-aside']//span[text()='" + menu_name + "']/ancestor::li"

    def level_two_menu(self, menu_name):
        """
        二级菜单栏，菜单栏名称
        :param menu_name:
        :return:
        """
        return "//aside[@class='el-aside']//span[text()='" + menu_name + "']/parent::li"

    # 作业内容
    def tabs(self, menu_name):
        return "//div[@class='el-tabs__nav is-top']//div[text()='" + menu_name + "']"


if __name__ == '__main__':
    print(LeftMenuBase().level_one_menu("产品"))
    print(LeftMenuBase().level_two_menu("我的商品列表"))
    print(LeftMenuBase().tabs("全部"))
